UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RAlKIIGewC1rsRMKgChA2HW/0wmSNYv9nZcgluM7lTI=' 
WHERE 
  key_id = 'dc03692adf9f1ca0bcb3066406ea6873ff301448cecbe73e8d9d2bce2d0f263c' 
  AND (
    token = 'RAlKIIGewC1rsRMKgChA2HW/0wmSNYv9nZcgluM7lTI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036