UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hECQVAvZxxgY7HnYOPjdVrZdWPnDjMWeJ5YKp/H3V+c=' 
WHERE 
  key_id = '7cb9d317551c6c481030c097b9e5b5b4c1c33c5b1e8c3a6ae2017ee8b3f83a40' 
  AND (
    token = 'hECQVAvZxxgY7HnYOPjdVrZdWPnDjMWeJ5YKp/H3V+c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031