UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r0/EOG9Iu/WfRzg6hWdbyC3ODMiGhD/vHxT4fC4HSZY='
WHERE
key_id = '6409f1de6771025e68989ef107d9d7a3295b51b5c4aac057a999f504a49fc7b2'
AND (
token = 'r0/EOG9Iu/WfRzg6hWdbyC3ODMiGhD/vHxT4fC4HSZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)