UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rd5HxDEYZ3ZYFbH7CWiNxgTFwxpJbs2two6+KxLF5Zw='
WHERE
key_id = 'e5e277d44dee56fe9b23da4d580a86eff926657b9bf9be258fa73899d660ddd3'
AND (
token = 'rd5HxDEYZ3ZYFbH7CWiNxgTFwxpJbs2two6+KxLF5Zw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)