UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gcqdQT/Julw73Z2qOOKyDacZW9YWchh9EOylqO3Ro90='
WHERE
key_id = 'c86603eb5d619909e127a9e02050dbf20a5739441a98712725ec0468447cb1d0'
AND (
token = 'gcqdQT/Julw73Z2qOOKyDacZW9YWchh9EOylqO3Ro90='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)