UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mln4X3frCEjV06b8NzDEmz+NhEbz5OecoF/Rc1dGLXo='
WHERE
key_id = 'a067dea5d5df4561e477a9a9f4e679c3e1eecd565f0f512e48ea3ccf21681d7c'
AND (
token = 'Mln4X3frCEjV06b8NzDEmz+NhEbz5OecoF/Rc1dGLXo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)