UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+bQPBWPUYCjaTF3zAZ6lfZlpQRP+2NTuipCA5lADKNs=' 
WHERE 
  key_id = '62476d0bec89de0c8944b8247c0c7d0a644d7679e71e6a48307234c7ce9539cc' 
  AND (
    token = '+bQPBWPUYCjaTF3zAZ6lfZlpQRP+2NTuipCA5lADKNs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041