UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4nnZoBMH/32zjFMGiuD2dHUsY0pF6MMFNlNBAafMyG4=' 
WHERE 
  key_id = '68305cf046a19447da4d1d3c0419e3c68da5627b6915130964e4d22794d51f79' 
  AND (
    token = '4nnZoBMH/32zjFMGiuD2dHUsY0pF6MMFNlNBAafMyG4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032