UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MaoR7wrp6uWbJqeqW55wz6LEvitw48eK+/0ETxM6EAU='
WHERE
key_id = '155d5807d0ceaf86a64e1e58fc1b366e5f029f2b7f487d1b45d76eb2222d59c5'
AND (
token = 'MaoR7wrp6uWbJqeqW55wz6LEvitw48eK+/0ETxM6EAU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)