UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pSkA+e6MAT9nn4O5NBaR1FTD4YQiFvS+1WTsyBorxXY=' 
WHERE 
  key_id = '95e8b4dd5a60954635e1d455ed9d844ca700d7d0b1ed03566d1a31a7525b625d' 
  AND (
    token = 'pSkA+e6MAT9nn4O5NBaR1FTD4YQiFvS+1WTsyBorxXY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038