UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yTO4fWSWDqnOUQkQq+0O9I/LhdG7AhCE7QfThXqKw88='
WHERE
key_id = '6e5c6c31454146e1184a99b61ca4144ca6409fbd89e988c080b7e82bcac01bfe'
AND (
token = 'yTO4fWSWDqnOUQkQq+0O9I/LhdG7AhCE7QfThXqKw88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)