UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5e0ubUebhZzKj4GjV2N6PNqUW0sYjoJMBQ6CCislYCs='
WHERE
key_id = 'a8e623d83c5e10374b3b3e32990a68cefc8f5ca7babce85fb8bdf064c4fe6f16'
AND (
token = '5e0ubUebhZzKj4GjV2N6PNqUW0sYjoJMBQ6CCislYCs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)