UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CD2e5jP0NovHz0YH/P1jk1d8522EJ9J4bIUwE2ZWz5c=' 
WHERE 
  key_id = '616748ce275fb0d8b1915485fbe9da58316004bb53d333e53f008057e0125217' 
  AND (
    token = 'CD2e5jP0NovHz0YH/P1jk1d8522EJ9J4bIUwE2ZWz5c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033