UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '02Mtyd0/1FKQ8vlB5qngAOxD2hI2bNkQccsncnNI1+g='
WHERE
key_id = '8e1cd5e426647fe61e6643abc883cdc22da6e1e296974a6cf46d8069e8917bc1'
AND (
token = '02Mtyd0/1FKQ8vlB5qngAOxD2hI2bNkQccsncnNI1+g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)