UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nmIILuKN3kB57kDirIUysNjHJj/eCeG7g0s2K9K6h1Y=' 
WHERE 
  key_id = '7c3c60c67a2e58015fbeed4cdd0bf9b2a2eb0b1c1957480857b92501feb3cd2f' 
  AND (
    token = 'nmIILuKN3kB57kDirIUysNjHJj/eCeG7g0s2K9K6h1Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024