UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CIMWqOWHXVNN86O4FMxWQd8I0vZk1PaQBCZ42JWeVQ0='
WHERE
key_id = '502a4c2a4e0b2c3aef1c9374488233c09f841f8f3da95299acdc934056c96ef1'
AND (
token = 'CIMWqOWHXVNN86O4FMxWQd8I0vZk1PaQBCZ42JWeVQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)