UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tBMNk+VOibdg9DrAMRVdpG06Dyq1yv9spozq1izz9XE='
WHERE
key_id = '1433b74cff7d87a7a20a6bf60e1071edeb2d2538348b977e6c318a4c92b7fd54'
AND (
token = 'tBMNk+VOibdg9DrAMRVdpG06Dyq1yv9spozq1izz9XE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)