UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T59V9/TIpSb37VhrwTFGTmF3skhPn7+2eS6pu/u9vzI=' 
WHERE 
  key_id = 'eb7101f829d4d43b917fb78292f1d26d908960b8d657821fce7b097813f40944' 
  AND (
    token = 'T59V9/TIpSb37VhrwTFGTmF3skhPn7+2eS6pu/u9vzI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030