UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nj5vsiUaAjGivawKrx5s5w5Kkxx+H/rgZ1rqtCz9odY=' 
WHERE 
  key_id = '4a2b7409f6c5757f5501a22fa0ade921511e3cddbe65398e24fb1732f7ca3e76' 
  AND (
    token = 'nj5vsiUaAjGivawKrx5s5w5Kkxx+H/rgZ1rqtCz9odY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039