UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zKjs9BfiReE02DNlrNVBygoeeXkw75y0gNGlAqhJaLE='
WHERE
key_id = 'abfd7786627c853469e95f5f1cc18fcd1a434dce8e4482859d7db51c9c27cd65'
AND (
token = 'zKjs9BfiReE02DNlrNVBygoeeXkw75y0gNGlAqhJaLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)