UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uKEi7J0Mt7jiRdFI2pcuRpGklvafK5pqM0hjUY4/988=' 
WHERE 
  key_id = '942f6636530f55f49059881a4751cb4818d643e2a2336817b248ba54534a63a4' 
  AND (
    token = 'uKEi7J0Mt7jiRdFI2pcuRpGklvafK5pqM0hjUY4/988=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037