UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FRAWZfI693qaEDb9HaaQBvvx/K20M68wd1uza7l8tcw=' 
WHERE 
  key_id = '758e7af99d734a0878e3325815a269c363d873bbb02c32c88608086e63454344' 
  AND (
    token = 'FRAWZfI693qaEDb9HaaQBvvx/K20M68wd1uza7l8tcw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015