UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mtcAvEI7qd/ly328qfkirjz0DTJiR8VXu5qx5u3dQSE='
WHERE
key_id = '5f55480cf2423539d8f2413a6a5cf20f5fa0254f3e6c484195affd184215b859'
AND (
token = 'mtcAvEI7qd/ly328qfkirjz0DTJiR8VXu5qx5u3dQSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)