UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FL7J0kHjgoIQ+sfzgoCh8K0/eOm19EMm4ur40qeuRss=' 
WHERE 
  key_id = '303e8bda7afedbe4b764a3c74c7a0779c9a136298dfd4101769672926ccd76d9' 
  AND (
    token = 'FL7J0kHjgoIQ+sfzgoCh8K0/eOm19EMm4ur40qeuRss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026