UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BHOZF/xxI3+T1SXat1hdcd/7WcSjQGS0Vzr7tL+qGpY=' 
WHERE 
  key_id = '5626f48d2acc3c8c105c2ee432d9a5970e7bbf15d9dc34ef266de61e1834ce60' 
  AND (
    token = 'BHOZF/xxI3+T1SXat1hdcd/7WcSjQGS0Vzr7tL+qGpY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049