UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JswCWhAWrtTq5gnlMN5Ox3x8Tf6c2M0jGIAZ0Sbtl/U='
WHERE
key_id = 'e99d3714ca0e434b0f5140c059cc7f78a676bda6f6b0c66af0ab1b916ebad293'
AND (
token = 'JswCWhAWrtTq5gnlMN5Ox3x8Tf6c2M0jGIAZ0Sbtl/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)