UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6kGxaNEOv5HqBAtJT7Nwlzy+qfnWPxsGSRbCVmcEr7o=' 
WHERE 
  key_id = '3d0c0c3696edf3d8123ff72b4d420894ce4e8da3ec5794d877b2e642fc935619' 
  AND (
    token = '6kGxaNEOv5HqBAtJT7Nwlzy+qfnWPxsGSRbCVmcEr7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033